﻿/******************************************************************************
* File description: Debugger.qml
* Function: 没啥用的用来显示调试信息的模块
* Current Version: 1.0.0
* Author: JNN
* Date: 2025-07-01
*  -----
*  Copyright by 博坤生物 .
 *****************************************************************************/
import QtQuick 2.0
import "../components"

Item {

    anchors.fill: parent
    visible: showDebug
    opacity: 0.2
    Column{
        Text {
            font.pixelSize: 10
            text: "当前缩放系数:" + dp.toFixed(2)
        }
        Text {
            font.pixelSize: 10
            text: "当前实验状态:" + "\n  gExpIsRunning:" + gExpIsRunning
                                + "\n  gExpIsFailure:" + gExpIsFailure
                                + "\n  gExpIsFailurePause:" + gExpIsFailurePause
                                + "\n  gExpIsPause:" + gExpIsPause
                                + "\n  gExpIsExecOperate:" + gExpIsExecOperate
        }
        Text {
            font.pixelSize: 10
            text: "当前故障状态:"+box_failureInfo2.showContinueButton
        }
        Text {
            font.pixelSize: 10
            text: "显示系统设置的状态:"+gIsShowPrefSettings
        }
    }

    Column{
        x: parent.width - 300*dp
        Text {
            font.pixelSize: 10
            text: "Method_M: " + gStateExp.mainMethod
        }
        Text {
            font.pixelSize: 10
            text: "Method_1: " + gStateExp.singleMethod_1
        }
        Text {
            font.pixelSize: 10
            text: "Method_2: " + gStateExp.singleMethod_2
        }
        Text {
            font.pixelSize: 10
            text: "Method_3: " + gStateExp.singleMethod_3
        }
        Text {
            font.pixelSize: 10
            text: "Method_4: " + gStateExp.singleMethod_4
        }
        Text {
            font.pixelSize: 10
            text: "Consume: " + gStateExp.consumableName
        }
        Text {
            font.pixelSize: 10
            text: "Select:  " + gStateExp.selectedExpType + " " + gStateExp.selectedExpName
        }
        CustomButton{
            title: "当前耗材编码校验：" + (isCheckConsumableCode ? "开" : "关")
            onClicked: {
                isCheckConsumableCode = !isCheckConsumableCode
            }
        }
        CustomButton{
            title: "执行实验恢复动画"
            height: 20*dp; width: 140*dp
            onClicked: {
                CAnimationRescue.parseDBInstruct(1)
            }
        }
        CustomButton{
            title: "实验恢复弹窗"
            height: 20*dp; width: 140*dp
            onClicked: {
                box_expRescue.show()
            }
        }
        CustomButton{
            title: "故障弹窗"
            height: 20*dp; width: 140*dp
            onClicked: {
                box_failureInfo2.show()
            }
        }
        CustomButton{
            title: "导出报告"
            height: 20*dp; width: 140*dp
            onClicked: {
                CExcelReport.exportExcel("", "");
            }
        }
        CustomButton{
            title: "发射并发故障"
            height: 20*dp; width: 140*dp
            onClicked: {
                CSignal.sendErrorMsg_Union()
            }
        }
        CustomButton{
            title: "发射流程故障"
            height: 20*dp; width: 140*dp
            onClicked: {
                CSignal.sendErrorMsg_Process()
            }
        }CustomButton{
            title: "发射断网故障"
            height: 20*dp; width: 140*dp
            onClicked: {
                gConnectStatus = false
            }
        }
        CustomButton{
            title: "并发状态" + gStateExp.isUnion
            height: 20*dp; width: 140*dp
            onClicked: {
                gStateExp.isUnion = !gStateExp.isUnion
            }
        }
        CustomButton{
            title: "打印报告"
            onClicked: {
                CPrinter.printExcel()
            }
        }
        CustomButton{
            title: "显示提示信息"
            onClicked: {
                toast.show("提示信息测试", 0)
            }
        }
    }

}
